﻿@{
    ViewBag.Title = "Paichedan";
    ViewBag.First = "派车单";
    ViewBag.Second = "单条派车纪录";
    Layout = null;
    var id = ViewData["id"].ToString();
}
<!DOCTYPE html>

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <style>
        td {
            border: solid #add9c0;
            border-width: 0px 1px 1px 0px;
            padding: 10px 0px;
            vertical-align: middle;
            text-align: center;
        }

        table {
            border: solid #add9c0;
            border-width: 1px 0px 0px 1px;
        }
    </style>
    <script src="~/Scripts/jquery-1.10.2.min.js"></script>
    <script src="~/Scripts/comm.js"></script>
    <script src="~/Content/laydate-v1.1/laydate/laydate.js"></script>
    <title>西南石油工程公司车辆派遣管理系统</title>
</head>

<body>

    <div id="divPrint">

        <table style="border:0px" width="100%" cellspacing="1" cellpadding="0"><tr><td style="border:0px;text-align:left; width:60px"><img src="~/Content/images/a1_logo.png" /></td><td id="tdTitle" style="border:0px;font-size:18px; font-weight:bold">四川钻井分公司派车单</td><td style="border:0px;width:60px">&nbsp;</td></tr></table>

        <table width="100%" cellspacing="1" cellpadding="0">
            <tr>
                <td width="70px">派车时间</td>
                <td id="pcsj" width="20%"></td>
                <td width="70px">用车部门</td>
                <td id="ycbm" width="20%">&nbsp;</td>
                <td width="40px" rowspan="5">安<br />全<br />提<br />示</td>
                <td width="200px" style="text-align:left;padding:10px 10px;" rowspan="5">
                    1、严格遵守《道路交通安全法》和公司《交通安全管理规定》；<br />
                    2、严禁超速、超载、酒后驾驶、疲劳驾驶、公车私用；<br />
                    3、复杂路况与恶劣天气必须减速慢性；<br />
                    4、做好事前预防、确保行车安全
                </td>
            </tr>
            <tr>
                <td>用车事由</td>
                <td id="reson" colspan="3">&nbsp;</td>
            </tr>
            <tr>
                <td>乘&nbsp;车&nbsp;人</td>
                <td id="ccr" colspan="3">&nbsp;</td>
            </tr>
            <tr>
                <td>驾&nbsp;驶&nbsp;员</td>
                <td id="jsy">&nbsp;</td>
                <td>所派车辆</td>
                <td id="cx">&nbsp;</td>
            </tr>
            <tr>
                <td>起&nbsp;&nbsp;&nbsp;点</td>
                <td id="qd">&nbsp;</td>
                <td>终&nbsp;&nbsp;&nbsp;点</td>
                <td id="zd">&nbsp;</td>
            </tr>
            <tr>
                <td>行车里程</td>
                <td>&nbsp;</td>
                <td>费&nbsp;&nbsp;&nbsp;用</td>
                <td>&nbsp;</td>
                <td rowspan="2" width="15px">重要提示</td>
                <td rowspan="2"><input id="zyts" placeholder="请填写重要提示" value="" style="border:none; width:90%;height:100%" type="text" /></td>
            </tr>
            <tr>
                <td>派&nbsp;车&nbsp;人</td>
                <td id="pcr">&nbsp;</td>
                <td>审&nbsp;批&nbsp;人</td>
                <td id="spr">&nbsp;</td>
            </tr>
            <tr>
                <td height="50px">备&nbsp;&nbsp;&nbsp;注</td>
                <td colspan="5"><input id="remark" placeholder="请填写备注" value="" style="border:none; width:90%;height:100%" type="text" /></td>
            </tr>
        </table>
    </div>
    <a href="javascript:printme()" target="_self">打印</a>


    <script type="text/javascript">
                $(function () {
                    var url = '@Url.Action("GetSendCarRecordForPrintById")';
                    $.post(url, {"id":'@id'},callback,'json');
                });

                function callback(o){
                    $("#pcsj").html(ChangeDateFormat(o.StartTime));
                    var orgz = o.Orgz;
                    $("#tdTitle").html(orgz.substring(0, orgz.indexOf('/')) + "派车单");
                    $("#ycbm").html(o.Orgz);
                    $("#jsy").html(o.DriverName);
                    $("#qd").html(o.StartAddress);
                    $("#zd").html(o.EndAddress);
                    $("#ccr").html(o.Remark);
                    $("#pcr").html(o.UserName);
                    if (o.ApproalUsers==null) {
                        $("#spr").html("无");
                    } else {
                        $("#spr").html(o.ApproalUsers);
                    }
                    $("#reson").html(o.Reson);
                    $("#cx").html(o.CarNo);
                }


                var global_Html = "";

                function printme() {
                    var beizhu = document.getElementById("remark").value ;
                    var zyts  =  document.getElementById("zyts").value ;
                    global_Html = document.body.innerHTML;
                    document.body.innerHTML = document.getElementById('divPrint').innerHTML;         　　　　　　　　　　　　　　
                    document.getElementById("remark").value =beizhu;
                    document.getElementById("remark").placeholder = '';
                    document.getElementById("zyts").value =zyts;
                    document.getElementById("zyts").placeholder = '';
                    window.print();

                    window.setTimeout(function () {

                        document.body.innerHTML = global_Html;
                        document.getElementById("remark").value =beizhu;
                        document.getElementById("zyts").value =zyts;
                    }, 100);

                }

    </script>
</body>


</html>
